/*
 */

package com.railway.msg.model;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;
import org.apache.commons.lang.StringUtils;

import com.railway.common.base.*;
import com.railway.common.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.railway.msg.model.*;
import com.railway.msg.constants.IConstant;
import com.railway.msg.dao.*;
import com.railway.msg.service.*;
import com.railway.msg.vo.query.*;

/**
 * @author jiangcheng
 * @version 1.0
 * @since 1.0
 */

public class MsgRecive extends BaseEntity implements java.io.Serializable {

	private static final long serialVersionUID = 5454155825314635342L;

	// alias
	public static final String TABLE_ALIAS = "接收消息列表";
	public static final String ALIAS_ID = "id";
	public static final String ALIAS_RECIVOR = "接收者";
	public static final String ALIAS_MSG_ID = "msgId";
	public static final String ALIAS_STATUS = "状态";
	public static final String ALIAS_READ_TIME = "接收时间";

	// date formats
	public static final String FORMAT_READ_TIME = DATE_TIME_FORMAT;

	// 可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	// columns START
	@Length(max = 32)
	private java.lang.String id;
	@Length(max = 32)
	private java.lang.String recivor;
	@Length(max = 32)
	private java.lang.String msgId;
	@Length(max = 3)
	private java.lang.String status;

	private java.util.Date readTime;
	private String readTimeString;
	// columns END

	private String title = null;

	private String content = null;
	private String creator = null;
	private Date createTime = null;
	private String createTimeString;
	private String accessoryName = null;
	private String accessoryPath = null;
	private String fileId = null;

	public String getFileId() {
		return fileId;
	}

	public void setFileId(String fileId) {
		this.fileId = fileId;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getCreator() {
		return creator;
	}

	public void setCreator(String creator) {
		this.creator = creator;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getAccessoryName() {
		return accessoryName;
	}

	public void setAccessoryName(String accessoryName) {
		this.accessoryName = accessoryName;
	}

	public String getAccessoryPath() {
		return accessoryPath;
	}

	public void setAccessoryPath(String accessoryPath) {
		this.accessoryPath = accessoryPath;
	}

	public MsgRecive() {

	}

	public MsgRecive(java.lang.String id) {
		this.id = id;
	}

	public void setId(java.lang.String value) {
		this.id = value;
	}

	public java.lang.String getId() {
		return this.id;
	}

	public void setRecivor(java.lang.String value) {
		this.recivor = value;
	}

	public java.lang.String getRecivor() {
		return this.recivor;
	}

	public void setMsgId(java.lang.String value) {
		this.msgId = value;
	}

	public java.lang.String getMsgId() {
		return this.msgId;
	}

	public void setStatus(java.lang.String value) {
		this.status = value;
	}

	public java.lang.String getStatus() {

		return this.status;
	}

	public String getReadTimeString() {
		return DateConvertUtils.format(getReadTime(), FORMAT_READ_TIME);
	}

 
	public void setReadTime(java.util.Date value) {
		this.readTime = value;
	}

	public java.util.Date getReadTime() {
		return this.readTime;
	}

	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
				.append("Id", getId()).append("Recivor", getRecivor()).append(
						"MsgId", getMsgId()).append("Status", getStatus())
				.append("ReadTime", getReadTime()).toString();
	}

	public int hashCode() {
		return new HashCodeBuilder().append(getId()).toHashCode();
	}

	public boolean equals(Object obj) {
		if (obj instanceof MsgRecive == false)
			return false;
		if (this == obj)
			return true;
		MsgRecive other = (MsgRecive) obj;
		return new EqualsBuilder().append(getId(), other.getId()).isEquals();
	}

	public String getCreateTimeString() {
		return DateConvertUtils.format(getCreateTime(), FORMAT_READ_TIME);
	}

	public void setCreateTimeString(String createTimeString) {
		this.createTimeString = createTimeString;
	}

 
	public void setReadTimeString(String readTimeString) {
		this.readTimeString = readTimeString;
	}
}
